﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   namespace="Bunian.Core.BusinessObjects"
                   assembly="Bunian.Core">

  <class name="Sponsor" table="Sponsors">

    <id name="Id" column="SponsorId" unsaved-value="0">
      <generator class="native"/>
    </id>

    <many-to-one name="ContactInfo" column="ContactId" class="Contact" cascade="all" />
    
    <bag name="Sponsorships" inverse="true" generic="true" cascade="all">
      <key column="SponsorId"/>
      <one-to-many class="Sponsorship" />
    </bag>
  
  </class>
</hibernate-mapping>